import { useEffect } from 'react';
import { useState } from 'react'
import MyComponent from './MyComponent'

function App() {
  const [satisfactionLevel,setSatisfactionLevel]=useState(301);
  console.log('App 更新了');
  useEffect(()=>{
    setTimeout(()=>{
      setSatisfactionLevel(310)
    },3000)
  },[])
  return (
    <div className="App">
      <input 
        type="range"
        min="0"
        max="500"
        value={satisfactionLevel} 
        onChange={(event)=>setSatisfactionLevel(+event.target.value)}
        />
      {/* {satisfactionLevel} */}
      <MyComponent level={satisfactionLevel}/>
    </div>
  )
}

export default App
